We will now use the notation \( \eval{f}_U \) for \( \res^V_U f \).
% Idea: Spec A has a sheaf O_{Spec A} such that value at U_f is A_f; globalise this to get the notion of a scheme.

\subsection{Localisation}
\begin{definition}
    Let \( A \) be a ring and \( S \subseteq A \) be a multiplicatively closed set.
    The \emph{localisation} of \( A \) at \( S \) is
    \[ S^{-1}A = \faktor{\qty{(a, s) \mid a \in A, s \in S}}{\sim} \]
    where
    \[ (a, s) \sim (a', s') \iff \exists s'' \in S,\, s''(as' - a's) = 0 \in A \]
\end{definition}
Examples of multiplicatively closed sets include the set of powers of a fixed element, or the complement of a prime ideal.
The pair \( (a, s) \) represents \( \frac{a}{s} \).
The extra \( s'' \) term represents a unit in this new ring, which may be needed in rings that are not integral domains.
\begin{remark}
    The natural map \( A \to S^{-1} A \) need not be injective, for example, if \( S \) contains a zero divisor.
\end{remark}
% We aim to define a sheaf \( \mathcal O_{\Spec A} \) on the topological space \( \Spec A \), such that the stalk at a prime \( \mathfrak p \) is \( (A \setminus \mathfrak p)^{-1} A \), and if \( U_f \) is a distinguished open, then \( \mathcal O_{\Spec A}(U_f) = A_f \).

\subsection{Sheaves on a base}
\begin{definition}
    Let \( X \) be a topological space and \( \mathcal B \) be a basis for the topology.
    A \emph{sheaf on the base \( \mathcal B \)} consists of assignments \( B_i \mapsto F(B_i) \) of abelian groups, with restriction maps \( \res_{B_j}^{B_i} : F(B_i) \to F(B_j) \) whenever \( B_j \subseteq B_i \) such that,
    \begin{enumerate}
        \item \( \res^{B_i}_{B_i} = \id_{B_i} \);
        \item \( \res^{B_j}_{B_k} \circ \res^{B_i}_{B_j} = \res^{B_i}_{B_k} \)
    \end{enumerate}
    with the additional axioms that
    \begin{enumerate}
        \item if \( B = \bigcup B_i \) with \( B, B_i \in \mathcal B \) and \( f, g \in F(B) \) such that \( \eval{f}_{B_i} = \eval{g}_{B_i} \) for all \( i \), then \( f = g \);
        \item if \( B = \bigcup B_i \) as above, with \( f_i \in F(B_i) \) such that for all \( i, j \) and \( B' \subseteq B_i \cap B_j \) with \( B' \in \mathcal B \), \( \eval{f_i}_{B'} = \eval{f_j}_{B'} \), then there exists \( f \in F(B) \) with \( \eval{f}_{B_i} = f_i \).
    \end{enumerate}
\end{definition}
This is very similar to the definition of a sheaf, but only specified on the basis.
\begin{proposition}
    Let \( F \) be a sheaf on a base \( \mathcal B \) of \( X \).
    This determines a sheaf \( \mathcal F \) on \( X \) such that \( \mathcal F(B) = F(B) \) for all \( B \in \mathcal B \), agreeing with restriction maps.
    Moreover, \( \mathcal F \) is unique up to unique isomorphism.
\end{proposition}
\begin{proof}
    We first define the stalks using \( F \):
    \[ \mathcal F_p = \faktor{\qty{(s_B, B) \mid p \in B \in \mathcal B, s_B \in F(B)}}{\sim} \]
    We then use a sheafification idea to define \( \mathcal F(U) \).
    The elements are the dependent functions \( f \in \prod_{p \in U} \mathcal F_p \) such that for each \( p \in U \), there exists a basic open set \( B \) containing \( p \) and a section \( s \in F(B) \) such that \( s_q = f_q \) in \( \mathcal F_q \) for all \( q \in B \).
    This is then clearly a sheaf.
    The natural maps \( F(B) \to \mathcal F(B) \) are isomorphisms by the sheaf axioms.
\end{proof}

\subsection{The structure sheaf}
Recall that the distinguished opens \( U_f, U_g \) coincide if and only if \( f, g \) are powers of some \( h \in A \).
Also, if \( U_f = U_g \) then \( A_f \cong A_g \).
Therefore, the assignment \( U_f \mapsto A_f \) is well-defined.
\begin{proposition}
    The assignment \( U_f \mapsto A_f \) defines a sheaf of rings on the base \( \qty{U_f} \) of the topological space \( \Spec A \).
\end{proposition}
\begin{remark}
    If \( \qty{U_{f_i}}_{i \in I} \) covers \( \Spec A \), there exists a finite subcover.
    Indeed, since the \( U_{f_i} \) cover \( \Spec A \), there is no prime ideal \( \mathfrak p \subseteq A \) containing all \( (f_i)_{i \in I} \).
    Equivalently, \( \sum_{i \in I} (f_i) = (1) \).
    In particular, \( 1 = \sum_{i \in J} a_i f_i \) for \( J \subseteq I \) finite.
    So \( \sum_{i \in J} (f_i) = (1) \), and thus \( \qty{U_{f_i}}_{i \in J} \) covers \( \Spec A \).
    We say that \( \Spec A \) is \emph{quasi-compact}; traditionally the word `compact' is reserved for Hausdorff spaces in the context of algebraic geometry.
\end{remark}
\begin{proof}
    We will check the axioms for the basic open set \( B = \Spec A \); the general case follows by applying this result to a localisation.
    Suppose \( \Spec A = \bigcup_{i = 1}^n U_{f_i} \); this union is finite by the previous remark.
    Let \( s \in A \) be such that \( \eval{s}_{U_i} = 0 \) for all \( i \).
    By the definition of localisation, as the set \( \qty{U_{f_i}} \) is finite there exists \( m \) such that \( f_i^m s = 0 \) for all \( i \).
    But note that \( (1) = (f_i^m)_{i = 1}^n \) for any \( m > 0 \) because the \( \qty{U_{f_i}}_{i=1}^n \) cover \( \Spec A \).
    Thus \( \qty{U_{f_i^m}}_{i=1}^n \) cover \( \Spec A \).
    \[ 1 = \sum r_i f_i^m \implies s = \sum r_i f_i^m s = 0 \]
    Now suppose \( \Spec A = \bigcup_{i \in I} U_{f_i} \), and \( s_i \in A_{f_i} \) are elements that agree in \( A_{f_i f_j} \).
    We need to build an element in \( A \) with these restrictions.

    First, suppose \( I \) is finite.
    On \( U_{f_i} \), we have chosen \( \frac{a_i}{f_i^{\ell_i}} \in A_{f_i} \); we write \( g_i = f_i^{\ell_i} \), noting that \( U_{f_i} = U_{g_i} \).
    On the overlaps, by hypothesis we have
    \[ (g_i g_j)^{m_{ij}} (a_i g_j - a_j g_i) = 0 \]
    Rewriting this using the fact that \( U_f = U_{f^k} \) for all \( k > 0 \), and assuming \( m = m_{ij} \) by taking the largest, we obtain
    \[ b_i = a_i g_i^m;\quad h_i = g_i^{m+1} \]
    so on each \( U_{h_i} \) we have chosen an element \( \frac{b_i}{h_i} \).
    Now, as the \( U_{h_i} = U_{f_i} \) cover \( \Spec A \), we have \( 1 = \sum r_i h_i \) for some \( r_i \in A \).
    We can thus construct \( r = \sum r_i b_i \) with the \( r_i \) as above.
    This construction then has the correct restrictions to \( \frac{b_i}{h_i} \) in \( U_{h_i} \).

    When \( I \) is infinite, choose \( (f_i)_{i=1}^n \) such that the \( U_{f_i} \) for \( i \in \qty{1, \dots, n} \) form a cover, and use the finite case to build \( r \in A \).
    This has the correct restrictions to the \( U_{f_i} \) for \( i \in \qty{1, \dots, n} \).
    Given \( (f_1, \dots, f_n, f_\alpha) = A \), the same construction gives a new \( r' \in A \), but then by the first sheaf axiom, \( r = r' \).
\end{proof}
\begin{definition}
    The \emph{structure sheaf} on \( \Spec A \) is the sheaf \( \mathcal O_{\Spec A} \) associated to the sheaf on the base of distinguished opens mapping \( U_f \) to \( A_f \).
\end{definition}
\begin{remark}
    The stalk \( \mathcal O_{\Spec A, \mathfrak p} \) is equal to \( A_{\mathfrak p} \).
\end{remark}

\subsection{Definitions and examples}
\begin{definition}
    A \emph{ringed space} \( (X, \mathcal O_X) \) is a topological space \( X \) with a sheaf of rings \( \mathcal O_X \).
    An isomorphism of ringed spaces \( (X, \mathcal O_X) \to (Y, \mathcal O_Y) \) is a homeomorphism \( \pi : X \to Y \) and an isomorphism \( \mathcal O_Y \to \pi_\star \mathcal O_X \) of sheaves on \( Y \).
\end{definition}
Note that for \( U \subseteq X \) open, \( U \) is naturally a ringed space with \( \mathcal O_U(V) = \mathcal O_X(V) \).
\begin{definition}
    An \emph{affine scheme} is a ringed space \( (X, \mathcal O_X) \) that is isomorphic to \( (\Spec A, \mathcal O_{\Spec A}) \).
\end{definition}
\begin{definition}
    A \emph{scheme} is a ringed space \( (X, \mathcal O_X) \) where every point \( p \in X \) has a neighbourhood \( U_p \) such that the ringed space \( (U_p, \mathcal O_{U_p}) \) is isomorphic to some affine scheme.
\end{definition}
% \item Let \( X = \Spec \mathbb C[x, y] \) and \( U = \qty{(x, y)}^c \).
% Then the scheme \( U \) is not an affine scheme.
% % exercise: why?
\begin{proposition}
    Let \( X \) be a scheme, \( U \subseteq X \) an open set, and \( i : U \rightarrowtail X \) be the inclusion map.
    Then, the ringed space \( (U, \mathcal O_U) \) is a scheme, where
    \[ \mathcal O_U = \eval{\mathcal O_X}_U = i^{-1} \mathcal O_X \]
\end{proposition}
For example, take \( X = \Spec A \) and \( U = U_f \) for some \( f \in A \).
Then \( (U, \mathcal O_U) \cong (\Spec A_f, \mathcal O_{\Spec A_f}) \).
\begin{proof}
    Let \( p \in U \subseteq X \).
    Since \( X \) is a scheme, we can find \( \qty(V_p, \eval{O_X}_{V_p}) \) inside \( X \) with \( p \in V_p \), such that \( V_p \) is isomorphic to an affine scheme.
    Then take \( V_p \cap U \subseteq U \) with structure sheaf given by the inclusion map.
    Note that \( V_p \cap U \) may not be affine, but \( V_p \cong \Spec B \), and the distinguished opens in \( \Spec B \) form a basis.
    This reduces the problem to the example of a distinguished open set above.
\end{proof}
\begin{definition}
    \emph{Affine space} of dimension \( n \) over \( k \) is defined to be
    \[ \mathbb A_k^n = \Spec k[x_1, \dots, x_n] \]
\end{definition}
\begin{example}
    Let
    \[ U = \mathbb A_k^{n^2} \setminus \qty{\det (x_{ij}) = 0} \]
    which is the open set representing \( GL_n(k) \).
    We will show that the multiplication map \( U \times U \to U \) is a morphism of schemes.
\end{example}
\begin{example}
    Let \( U = \mathbb A_k^2 \setminus (x, y) \).
    This is a scheme representing a plane without an origin.
    We claim that \( U \) is not an affine scheme.
    Suppose that \( U \) were affine; we aim to calculate \( \mathcal O_U(U) \).
    Write
    \[ U_x = \mathbb V(x)^c \subseteq \mathbb A_k^2;\quad U_y = \mathbb V(y)^c \subseteq \mathbb A_k^2 \]
    These two open sets cover \( U \), and
    \[ U_x \cap U_y = U_{xy} = \mathbb A_k^2 \setminus \mathbb V(xy) \]
    Then,
    \[ \mathcal O_U(U_x) = k[x,x^{-1},y];\quad \mathcal O_U(U_y) = k[x,y,y^{-1}];\quad \mathcal O_U(U_x \cap U_y) = k[x,x^{-1},y,y^{-1}] \]
    The restriction maps \( \mathcal O_U(U_x) \to \mathcal O_U(U_{xy}) \) and \( \mathcal O_U(U_y) \to \mathcal O_U(U_{xy}) \) are the obvious ones.
    By the sheaf axioms,
    \[ \mathcal O_U(U) = k[x,x^{-1},y] \cap k[x,y,y^{-1}] \subseteq k[x,x^{-1},y,y^{-1}] \]
    Thus, \( \mathcal O_U(U) = k[x,y] \).
    This is a contradiction: one way to see this is that there exists a maximal ideal \( (x, y) \) in the ring of global sections in \( (U, \mathcal O_U) \) with empty vanishing locus.

    In general, if \( X \) is a scheme, \( f \in \Gamma(X, \mathcal O_X) = \mathcal O_X(X) \), and \( p \in X \), then there is a well-defined stalk \( \mathcal O_{X,p} \) at \( p \), which is of the form \( A_{\mathfrak p} \) up to isomorphism, where \( \mathfrak p \) is a prime ideal.
    To say this, we are using an isomorphism of an open set \( V_p \) containing \( p \) to \( \Spec A \).
    In particular, \( A_{\mathfrak p} \) has a unique maximal ideal, namely \( \mathfrak p A_{\mathfrak p} \).
    We say that \( f \) vanishes at \( p \) if its image in \( \faktor{A_{\mathfrak p}}{\mathfrak p A_{\mathfrak p}} \), or equivalently, \( f \in \mathfrak p A_{\mathfrak p} \).
    As a consequence, the vanishing locus \( \mathbb V(f) \subseteq X \) is well-defined.
\end{example}

\subsection{Gluing sheaves}
Let \( X \) be a topological space with a cover \( \qty{U_\alpha} \).
Let \( \qty{\mathcal F_\alpha} \) be sheaves on \( \qty{U_\alpha} \), with isomorphisms
\[ \varphi_{\alpha\beta} : \eval{\mathcal F_\alpha}_{U_\alpha \cap U_\beta} \to \eval{\mathcal F_\beta}_{U_\alpha \cap U_\beta} \]
such that
\[ \varphi_{\alpha\alpha} = \id;\quad \varphi_{\alpha\beta} = \varphi_{\beta\alpha}^{-1};\quad \varphi_{\beta\gamma} \circ \varphi_{\alpha\beta} = \varphi_{\alpha\gamma} \]
The last equation is called the \emph{cocycle condition}.
This combination of conditions resembles the definition of an equivalence relation, with reflexivity, symmetry, and transitivity.

We will construct a sheaf \( \mathcal F \) on \( X \).
Given \( V \subseteq X \) open, we define
\[ \mathcal F(V) = \qty{(s_\alpha) \in \prod_\alpha \mathcal F_\alpha(U_\alpha \cap V) \midd \varphi_{\alpha\beta}\qty(\eval{s_\alpha}_{V \cap U_\alpha \cap U_\beta}) = \eval{s_\beta}_{V \cap U_\alpha \cap U_\beta}} \]
\( \mathcal F \) is a presheaf.
Indeed, given \( (s_\alpha) \in \mathcal F(V) \) and \( W \subseteq V \) open, we take
\[ \eval{(s_\alpha)}_W = \qty(\res_{W \cap U_\alpha}^{V \cap U_\alpha}(s_\alpha))_\alpha \]
This lies in \( \mathcal F(W) \) by the sheaf axioms.
One check easily check that this is a sheaf.
\begin{proposition}
    \( \eval{\mathcal F}_{U_\gamma} \) and \( \mathcal F_\gamma \) are canonically isomorphic as sheaves on \( U_\gamma \).
\end{proposition}
\begin{proof}
    First, we construct a map \( \mathcal F_\gamma \to \eval{\mathcal F}_{U_\gamma} \).
    Let \( V \subseteq U_\gamma \) and \( s \in \mathcal F_\gamma(V) \).
    Define its image in \( \eval{\mathcal F}_{U_\gamma} \) to be
    \[ \varphi_{\gamma\alpha}\qty(\eval{s}_{V \cap U_\alpha})_\alpha \]
    We must check that this tuple lies in \( \eval{\mathcal F}_{U_\gamma}(V) = \mathcal F(V) \).
    \[ \varphi_{\alpha\beta} \circ \varphi_{\gamma\alpha}\qty(\eval{s}_{V \cap U_\alpha \cap U_\beta}) = \varphi_{\gamma\beta}\qty(\eval{s}_{V \cap U_\alpha \cap U_\beta}) \]
\end{proof}

\subsection{Gluing schemes}
Let \( (X, \mathcal O_X) \) and \( (Y, \mathcal O_Y) \) be schemes with open sets \( U \subseteq X, V \subseteq Y \), and let \( \varphi : (U, \eval{\mathcal O_X}_U) \to (V, \eval{\mathcal O_Y}_V) \) be an isomorphism.
The topological spaces \( X, Y \) can be glued on \( U, V \) using \( \varphi \).

First, take \( S = \faktor{X \sqcup Y}{U \sim V} \).
By definition of the quotient topology, the images of \( X \) and \( Y \) in \( S \) form an open cover, and their intersection is the image of \( U \), or equivalently, the image of \( V \).
Now, we can glue the structure sheaves on these open sets as described in the previous subsection.
Note that in this case, there is no cocycle condition.
\begin{example}[the bug-eyed line; the line with doubled origin]
    Let \( k \) be a field.
    Let \( X = \Spec k[t] \) and \( Y = \Spec k[u] \).
    Let
    \[ U = \Spec k[t, t^{-1}] = \Spec k[t]_t = U_t \subseteq X;\quad V = \Spec k[u, u^{-1}] = \Spec k[u]_u = U_u \subseteq Y \]
    We define the isomorphism \( \varphi : U \to V \) given by \( t \mapsfrom u \).
    Technically, we define an isomorphism of rings \( k[u, u^{-1}] \to k[t, t^{-1}] \) by \( u \mapsto t \) and then apply \( \Spec \).
    At the level of topological spaces, \( X = \mathbb A^1_k \) and \( Y = \mathbb A^1_k \), so \( U = \mathbb A^1_k \setminus \qty{(t)} \) and \( V = \mathbb A^1_k \setminus \qty{(u)} \).
    Gluing along this isomorphism, we obtain a scheme \( S \) which is a copy of \( \mathbb A^1_k \) but with two origins.
    Note that the generic points in \( X \) and \( Y \) lie in \( U \) and \( V \) respectively, and thus are glued into a single generic point in \( S \).

    Consider the open sets in \( S \).
    Open sets entirely contained within \( X \) and \( Y \) yield open sets in \( S \).
    We also have open sets of the form \( W = S \setminus \qty{\mathfrak p_1, \dots, \mathfrak p_r} \) where \( \mathfrak p_i \) is contained in \( U \) or \( V \).
    One example is \( W = S \); we can calculate \( \mathcal O_S(S) \) using the sheaf axioms, and one can show that it is isomorphic to \( k[t] \).
    We can conclude that \( S \) is not an affine scheme, because there is a maximal ideal in \( k[t] \) where the vanishing locus is precisely two points.
\end{example}
\begin{example}[the projective line]
    Let \( X = \Spec k[t] \) and \( Y = \Spec k[s] \), and define \( U = \Spec k[t,t^{-1}], V = \Spec k[s,s^{-1}] \) as above.
    We glue these schemes using the isomorphism \( s \mapsto t^{-1} \), giving the projective line \( \mathbb P^1_k \).
\end{example}
\begin{proposition}
    \( \mathcal O_{\mathbb P^1_k}(\mathbb P^1_k) = k \).
\end{proposition}
% this does not require that k is algebraically closed
\begin{proof}[Proof sketch]
    We use the same idea as in the previous example.
    The only elements of \( k[t, t^{-1}] \) that are both polynomials in \( t \) and \( t^{-1} \) are the constants.
    % important exercise.
\end{proof}
In particular, \( \mathbb P^1_k \) is not an affine scheme.
\begin{example}
    We can similarly build a scheme \( S \) which is a copy of \( \mathbb A^2_k \) with a doubled origin.
    This has the interesting property that there exist affine open subschemes \( U_1, U_2 \subseteq S \) such that \( U_1 \cap U_2 \) is not affine; we can take \( U_1 \) and \( U_2 \) to be \( S \) but with one of the origins deleted.
    Note that \( \mathbb A^1_k \) without the origin is affine.
\end{example}

Let \( \qty{X_i}_{i \in I} \) be schemes, \( X_{ij} \subseteq X_i \) be open subschemes, and \( f_{ij} : X_{ij} \to X_{ji} \) be isomorphisms such that
\[ f_{ii} = \id_{X_i};\quad f_{ij} = f_{ji}^{-1};\quad f_{ik} = f_{jk} \circ f_{ij} \]
where the last equality holds whenever it is defined.
Then there is a unique scheme \( X \) with an open cover by the \( X_i \), glued along these isomorphisms.
This is an elaboration of the above construction, which is discussed on the first example sheet.

Let \( A \) be a ring, and let \( X_i = \Spec A\qty[\frac{x_0}{x_i}, \dots, \frac{x_n}{x_i}] \).
Let \( X_{ij} = \mathbb V\qty(\frac{x_j}{x_i})^c \subseteq X_i \).
We define the isomorphisms \( X_{ij} \to X_{ji} \) by \( \frac{x_k}{x_i} \mapsto \frac{x_k}{x_j} \qty(\frac{x_i}{x_j})^{-1} \).
The resulting glued scheme is called \emph{projective \( n \)-space}, denoted \( \mathbb P^n_A \).
% exercise: \mathcal O_{\mathbb P^n_A}(\mathbb P^n_A) = A.

\subsection{The Proj construction}
\begin{definition}
    A \emph{\( \mathbb Z \)-grading} on a ring \( A \) is a decomposition
    \[ A = \bigoplus_{i \in \mathbb Z} A_i \]
    as abelian groups, such that \( A_i A_j \subseteq A_{i+j} \).
\end{definition}
\begin{example}
    Let \( A = k[x_0, \dots, x_n] \), and let \( A_d \) be the set of degree \( d \) homogeneous polynomials, together with the zero polynomial.
\end{example}
\begin{example}
    Let \( I \subseteq k[x_0, \dots, x_n] \) be a homogeneous ideal; that is, an ideal generated by homogeneous elements of possibly different degrees.
    Then, for \( A = k[x_0, \dots, x_n] \), the ring \( \faktor{A}{I} \) is also naturally graded.
    % how?
\end{example}
Note that by definition, \( A_0 \) is a subring of \( A \).
For simplicity, we will always assume in this course that the degree 1 elements of a graded ring generate \( A \) as an algebra over \( A_0 \).
We also typically assume that \( A_i = 0 \) for \( i < 0 \).
We define
\[ A_+ = \bigoplus_{i \geq 1} A_i \subseteq A \]
This forms an ideal in \( A \), called the \emph{irrelevant ideal}.
If \( A \) is a polynomial ring with the usual grading, the irrelevant ideal corresponds to the point \( \vb 0 \) in the theory of varieties.
This aligns with the definition of projective space in classical algebraic geometry, in which the point \( \vb 0 \) is deleted.

A \emph{homogeneous element} \( f \in A \) is an element contained in some \( A_d \).
An ideal \( I \) of \( A \) is called \emph{homogeneous} if it is generated by homogeneous elements.
\begin{definition}
    Let \( A \) be a graded ring.
    \( \Proj A \) is the set of homogeneous prime ideals in \( A \) that do not contain the irrelevant ideal.
    If \( I \subseteq A \) is homogeneous, we define
    \[ \mathbb V(I) = \qty{\mathfrak p \in \Proj A \mid I \subseteq \mathfrak p} \]
    The \emph{Zariski topology} on \( \Proj A \) is the topology where the closed sets are of the form \( \mathbb V(I) \) where \( I \) is a homogeneous ideal.
\end{definition}
The Spec construction allows us to convert rings into schemes; the Proj construction allows us to convert graded rings into schemes.
Unlike Spec, the construction of Proj is not functorial.

Let \( f \in A_1 \) and \( U_f = \Proj A \setminus \mathbb V(f) \).
Observe that the set \( \qty{U_f}_{f \in A_1} \) covers \( \Proj A \), because the \( f \) generate the unit ideal.
The ring \( A\qty[\frac{1}{f}] = A_f \) is naturally \( \mathbb Z \)-graded by defining \( \deg \frac{1}{f} = -\deg f \).
Note that \( A_f \) may have negatively graded elements, even though \( A \) does not.
\begin{example}
    Let \( A = k[x_0, x_1] \) and \( f = x_0 \).
    Then in \( A\qty[\frac{1}{f}] = k[x_0, x_1, x_0^{-1}] \), the degree zero elements include \( k \) and elements such as \( \frac{x_1}{x_0}, \frac{x_1^2 + x_1 x_0}{x_0^2} \).
    There are degree one elements such as \( \frac{x_1^2}{x_0} \).
\end{example}
\begin{proposition}
    There is a natural bijection
    \[ \qty{\text{homogeneous prime ideals in \( A \) that miss \( f \)}} \leftrightarrow \qty{\text{prime ideals in } (A_f)_0} \]
\end{proposition}
Note also that the set of homogeneous prime ideals in \( A \) that miss \( f \) are naturally in bijection with the homogeneous prime ideals in \( A_f \).
\begin{proof}
    Suppose \( \mathfrak q \) is a prime ideal in \( \qty(A\qty[\frac{1}{f}])_0 \).
    Then let \( \psi(\mathfrak q) \) be the ideal
    \[ \psi(\mathfrak q) = \qty( \bigcup_{d \geq 0} \qty{a \in A_d \midd \frac{a}{f^d} \in \mathfrak q} \subseteq A ) \]
    One can check that this is prime.
    Now suppose \( \mathfrak p \) is a homogeneous prime ideal missing \( f \).
    Define \( \varphi(\mathfrak p) \) to be
    \[ \varphi(\mathfrak p) = \qty(p \cdot A\qty[\frac{1}{f}] \cap \qty(A\qty[\frac{1}{f}])_0) \]
    This ideal is also prime.

    One can easily check that \( \varphi \circ \psi \) is the identity.
    For the other direction, suppose \( \mathfrak p \) is a homogeneous prime ideal missing \( f \); we show that \( \mathfrak p = \psi(\varphi(\mathfrak p)) \) by antisymmetry.
    If \( a \in \mathfrak p \in A_d \), then \( \frac{a}{f^d} \in \varphi(\mathfrak p) \), so \( a \in \psi(\varphi(\mathfrak p)) \) by construction.
    Conversely, if \( a \in \psi(\varphi(\mathfrak p)) \), then \( \frac{a}{f^d} \in \varphi(\mathfrak p) \) for some \( d \), so there exists \( b \in \mathfrak p \) such that \( \frac{b}{f^e} = \frac{a}{f^d} \) in \( A\qty[\frac{1}{f}] \).
    Hence for some \( k \geq 0 \), we have \( f^k (f^d b - f^e a) = 0 \), and \( f^{e+k} \notin \mathfrak p \).
    But by primality, \( a \in \mathfrak p \), as required.
\end{proof}
The bijection constructed is compatible with ideal containment, so is a homeomorphism of topological spaces
\[ U_f \leftrightarrow \Spec (A_f)_0 \]
Thus \( \Proj A \) is covered by open sets homeomorphic to an affine scheme.
If \( f, g \in A_1 \), then \( U_f \cap U_g \) is naturally homeomorphic to
\[ \qty(\Spec A\qty[\frac{1}{f}])_0\qty[\frac{f}{g}] = \Spec \qty(A\qty[f^{-1}, g^{-1}])_0 \]
Take the open cover \( \qty{U_f} \) with structure sheaf \( \mathcal O_{\Spec (A_f)_0} \) on each \( U_f \), and isomorphisms on \( U_f \cap U_g \) by the condition above.
The cocycle condition follows from the formal properties of the localisation.
Therefore, \( \Proj A \) is a scheme.

If \( A = k[x_0, \dots, x_n] \) with the standard grading, we write \( \mathbb P^n_k \) for \( \Proj A \).
